BSP_ROOT ?= /home/sszl/arm/RTOS/rt-thread4.0.2/bsp/stm32/User_Bsp_NB
RTT_ROOT ?= /home/sszl/arm/RTOS/rt-thread4.0.2

CROSS_COMPILE ?=/home/sszl/arm/arm-gcc/gcc-arm-none-eabi-6_2-2016q4/bin/arm-none-eabi-

CFLAGS := -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections  -Dgcc -O2
AFLAGS := -c -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections  -x assembler-with-cpp -Wa,-mimplicit-it=thumb 
LFLAGS := -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections  -Wl,--gc-sections,-Map=rt-thread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds
CXXFLAGS := -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections  -Dgcc -O2

CPPPATHS :=-I$(BSP_ROOT) \
	-I$(BSP_ROOT)/applications \
	-I$(BSP_ROOT)/board \
	-I$(BSP_ROOT)/board/CubeMX_Config/Inc \
	-I$(BSP_ROOT)/board/ports \
	-I$(BSP_ROOT)/mycomponents/TEXT \
	-I$(BSP_ROOT)/packages/CmBacktrace-latest \
	-I$(BSP_ROOT)/packages/button-v1.0.1 \
	-I$(BSP_ROOT)/packages/cJSON-v1.0.2 \
	-I$(BSP_ROOT)/packages/fal-latest/inc \
	-I$(BSP_ROOT)/packages/sht2x-latest \
	-I$(BSP_ROOT)/packages/u8g2-cpp-latest \
	-I$(BSP_ROOT)/packages/u8g2-cpp-latest/port \
	-I$(RTT_ROOT)/bsp/stm32/libraries/HAL_Drivers \
	-I$(RTT_ROOT)/bsp/stm32/libraries/HAL_Drivers/config \
	-I$(RTT_ROOT)/bsp/stm32/libraries/HAL_Drivers/drv_flash \
	-I$(RTT_ROOT)/bsp/stm32/libraries/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Include \
	-I$(RTT_ROOT)/bsp/stm32/libraries/STM32F1xx_HAL/CMSIS/Include \
	-I$(RTT_ROOT)/bsp/stm32/libraries/STM32F1xx_HAL/STM32F1xx_HAL_Driver/Inc \
	-I$(RTT_ROOT)/components/cplusplus \
	-I$(RTT_ROOT)/components/dfs/filesystems/devfs \
	-I$(RTT_ROOT)/components/dfs/filesystems/elmfat \
	-I$(RTT_ROOT)/components/dfs/include \
	-I$(RTT_ROOT)/components/drivers/include \
	-I$(RTT_ROOT)/components/drivers/sensors \
	-I$(RTT_ROOT)/components/drivers/spi \
	-I$(RTT_ROOT)/components/drivers/spi/sfud/inc \
	-I$(RTT_ROOT)/components/finsh \
	-I$(RTT_ROOT)/components/libc/compilers/newlib \
	-I$(RTT_ROOT)/components/net/at/include \
	-I$(RTT_ROOT)/components/net/netdev/include \
	-I$(RTT_ROOT)/include \
	-I$(RTT_ROOT)/libcpu/arm/common \
	-I$(RTT_ROOT)/libcpu/arm/cortex-m3 

DEFINES := -DHAVE_CCONFIG_H -DRT_USING_NEWLIB -DSTM32F103xE -DUSE_HAL_DRIVER
